package io.bdmc.modules.bss.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.bdmc.modules.bss.entity.DeviceMachineDts;
import io.bdmc.modules.bss.mapper.DeviceMachineDtsMapper;
import io.bdmc.modules.bss.service.IDeviceMachineDtsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ping
 * @since 2021-11-19
 */
@Service
public class DeviceMachineDtsServiceImpl extends ServiceImpl<DeviceMachineDtsMapper, DeviceMachineDts> implements IDeviceMachineDtsService {

    @Override
    public DeviceMachineDts getByDeviceId(int deviceId) {
        QueryWrapper<DeviceMachineDts> w = new QueryWrapper<DeviceMachineDts>().eq("device_id",deviceId).last("limit 1");
        return getOne(w);
    }
}
